<:!:/>

@file s.login.html
@author Alejandro Dario Simi
@date $Date: 2013-06-17 01:26:11 +0000 (Mon, 17 Jun 2013) $

$Id: s.login.html 74 2013-06-17 01:26:11Z daemonraco@gmail.com $
$URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0-BETA2/themes/default/templates/simplecontainer/s.login.html $

<::/><script type="text/javascript">
	function SendAuth() {
		jQuery.post('service.php?action=<:VAR:/>WC_SERVICE_LOG_IN<::/>', {
			'username':	$("#USERNAME").val(),
			'password':	$("#PASSWORD").val(),
			'keepme':	$("#KEEPME").attr('checked') ? "Y" : "N"
		}, function(data){
			var	xml = $($.parseXML(data));
			if(xml.find("wc-success").length) {
				$("#WARNING").attr("class", "SuccessMessage");
				$("#WARNING").text("Success");
				ReloadHome();
			} else if(xml.find("wc-failed").length) {
				var	error = "";
				if(xml.find("wc-error>wc-code").length) {
					error = xml.find("wc-error>wc-code").text() + ": ";
				}
				error = error + xml.find("wc-error>wc-message").text();

				$("#WARNING").attr("class", "WarningMessage");
				$("#WARNING").text(error);
			}
			$("#USERNAME").focus();
			setTimeout("$('#WARNING').text('');", 2000);
		});
	}

	wcSimpleContainer.whenOpened(function(window){
		window.title("Log In");

		var	lastUser	= $.cookie("<:VAR:/>WC_COOKIE_KEEPME_NAME<::/>");
		if(lastUser) {
			$("#USERNAME").val(lastUser);
			$("#PASSWORD").focus();
		} else {
			$("#USERNAME").focus();
		}
	});
</script>

<form id="EditForm" action="#" method="POST" onSubmit="SendAuth();return false;">
	<table><tr>
		<td class="Label"><label for="USERNAME">Username:</label></td>
		<td class="Value"><input type="text"     id="USERNAME" name="USERNAME" value="<:VAR:!:/>LAST-USER-USERNAME<::/>" tabindex="1"/></td>
	</tr><tr>
		<td class="Label"><label for="PASSWORD">Password:</label></td>
		<td class="Value"><input type="password" id="PASSWORD" name="PASSWORD" value="" tabindex="2"/></td>
	</tr><tr>
		<td colspan="2" class="Buttons">
			<input type="checkbox" id="KEEPME" name="KEEPME" value="" tabindex="3"/><label for="KEEPME">Remember me</label>
		</td>
	</tr><tr>
		<td colspan="2" class="Buttons">
			<input type="submit" value="Log In"/>
			<input type="submit" value="Cancel" onclick="wcSimpleContainer.close();return false;"/>
		</td>
	</tr><tr>
		<td colspan="2"><a href="?action=<:VAR:/>WC_ACTION_USER_RESET<::/>&rgoup=<:VAR:/>GROUP-ID<::/>">Did you lost your username or password?</a></td>
	</tr><tr>
		<td colspan="2" id="WARNING" class="WarningMessage"></td>
	</tr></table>
</form>
